// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Fastclick from 'fastclick'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import { HappyScroll } from 'vue-happy-scroll'
import Antd from 'ant-design-vue'

import 'ant-design-vue/dist/antd.css'
import 'swiper/dist/css/swiper.css'
import 'vue-happy-scroll/docs/happy-scroll.css'
import '../static/css/reset.css'
import '../static/css/comm.css'
import '../static/js/rem.js'
import '../static/css/patient.css'

Vue.config.productionTip = false
Fastclick.attach(document.body)
// 滑动插件swiper
Vue.use(VueAwesomeSwiper)
Vue.use(Antd)
Vue.component('happy-scroll', HappyScroll)

/* eslint-disable no-new */
Vue.prototype.timeFormate = function () { // timeFormate是函数名
  let year = new Date().getFullYear()
  let month =
    new Date().getMonth() + 1 < 10
      ? '0' + (new Date().getMonth() + 1)
      : new Date().getMonth() + 1
  let date =
    new Date().getDate() < 10
      ? '0' + new Date().getDate()
      : new Date().getDate()
  let hh =
    new Date().getHours() < 10
      ? '0' + new Date().getHours()
      : new Date().getHours()
  let mm =
    new Date().getMinutes() < 10
      ? '0' + new Date().getMinutes()
      : new Date().getMinutes()
  var day = '日一二三四五六'.charAt(new Date().getDay())
  let nowTime =
    ' ' + hh + ':' + mm
  let data =
    year + '年' + month + '月' + date + '日'
  let currentTime =
    '周' + day
  return {'data': data, 'nowTime': nowTime, 'currentTime': currentTime}
}
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
